import React, { useContext, useMemo } from 'react'
import AppContext from './context'

const A: React.FC = () => {
	const { state, dispatch }: any = useContext(AppContext)
	console.log('useContext/a.tsx...', state)
	return useMemo(() => {
		return (
			<div>
				A =&gt; 名字:
				<button onClick={() => dispatch('add')}>
					countA++ =&gt; {state.count}
				</button><button onClick={() => dispatch('step')}>
					stepA++ =&gt; {state.step}
				</button>
			</div>
		)
	}, [state.count, state.step, dispatch])
}
export default A
